#include "stdafx.h"
#include "SDLGmud.h"

bool SDLGmud::OnInit() 
{    
	//We are telling SDL to Initialize everything it has
	//This is the first thing we should do: start SDL itself
	if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
	{
		return false;
	}

	//The next thing is to set video mode, which creates our window and our surface
	//4 params: the width of the window, the height of the window, 
	//the bit resolution of the window (recommended to be 16 or 32), and then display flags
	//Another flag that may interest you now is SDL_FULLSCREEN
	if((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL)
	{
		return false;
	}

	//Now let's actually load an image
	if((Surf_Test = SDLSurface::OnLoad("fishingisland.bmp")) == NULL)
	{
		return false;
	}

	return true;
}